/* Author : Putri Andita R
 * 		    091511059
 * Proyek 4*/


package jtk.project4.fleet.field;


import jtk.project4.fleet.domain.Parts;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;


public class PartInventoryTableField extends GroupControl<PartInventoryTableField>{
	
	private TableField<Parts>  partInventoryTable;
	
	public PartInventoryTableField(String bindID){
		setBindID(bindID);
		createFields();
		createLayout();
	}	
	
	private void createFields() {
		//setup table
		partInventoryTable = new TableField<Parts>("partInventorys","partInventory");
		partInventoryTable.setTitle("headerpartInventoryTable");
		partInventoryTable.setAutoResizeMode(AutoResizeMode.ALL_COLUMNS);
		partInventoryTable.getSelectionValues();
		
		//add columns
		partInventoryTable.addColumn("label.qty","qty");
		partInventoryTable.addColumn("label.location","locId");
		partInventoryTable.addColumn("label.aisle","");
		partInventoryTable.addColumn("label.row","row");
		partInventoryTable.addColumn("label.bin","bin");
		//partInventoryTable.addColumn("label.vendor","vendor");
	}
	
	private void createLayout() {
		// TODO Auto-generated method stub
		addField(createFieldGroup(),CENTER);
	}
	
	
	private GroupControl createFieldGroup(){
		GroupControl fieldGroup=new GroupControl();
		fieldGroup.addField(partInventoryTable,CENTER);
		return fieldGroup;
	}	
}
